<?php
include_once ("Login/databaseconnection.php");
require_once ("Login/config.php");
if($_GET['p']!="")
  {
  $param=$_GET['p'];
   $array= explode(",",$param);
$tab=$array[0];
$col=$array[1];
$val=$array[2];
$quet="SHOW COLUMNS FROM $tab";
$resultcolt=mysql_query($quet);
$qu="SELECT * FROM $tab WHERE ".$col."='$val'";
$nc=mysql_num_rows($resultcolt);
	  $seaquery=mysql_query($qu);
	  if(mysql_num_rows($seaquery)!=0)
	  {
	   echo '<br/>';
	  echo '<br/>';
	  echo '<br/>';
	 		  echo '<table border="1" class="tablefontv" align="left">';
		     echo '<tr bgcolor="#6AB5FF">';
		  while($rowsea=mysql_fetch_row($resultcolt))
		  {
			echo '<td>'.$rowsea[0].'</td>';
		  }
		    echo '</tr>';
			 echo '<tr>';
		 while($rowqu=mysql_fetch_array($seaquery))
		  {
		  for($i=0;$i<$nc;$i++)
		  {
		  echo '<td bgcolor="#999999">'.$rowqu[$i].'</td>';
			  }
			   echo '</tr>';
			   }
			  
			   echo '</table>';
			  }
			   ?>
	  <br/>
      <br/>
      <br/><img src="images/b_print.png" onClick="window.print()"/>
   	  <?php
	  }
?>
